Add sandbox/gym environment for safe AI development#2
Draft
Add sandbox/gym environment for safe AI development#2
Conversation
Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Dax Raad <d@ironbay.co>
…if not current day (anomalyco#4503) Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Dax Raad <d@ironbay.co> Co-authored-by: opencode <opencode@sst.dev>
Co-authored-by: ferg-cod3s <28580642+ferg-cod3s@users.noreply.github.com>
Co-authored-by: ferg-cod3s <28580642+ferg-cod3s@users.noreply.github.com>
Co-authored-by: ferg-cod3s <28580642+ferg-cod3s@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement sandbox environment for OpenCode development
Add sandbox/gym environment for safe AI development
Nov 27, 2025
v1truv1us
approved these changes
Nov 27, 2025
Owner
|
@copilot review the failing checks and address the problems |
Co-authored-by: ferg-cod3s <28580642+ferg-cod3s@users.noreply.github.com>
Co-authored-by: ferg-cod3s <28580642+ferg-cod3s@users.noreply.github.com>
Co-authored-by: ferg-cod3s <28580642+ferg-cod3s@users.noreply.github.com>
Author
Fixed the TypeScript typecheck failures in commit |
4b65759 to
d7c4c3b
Compare
4b65759 to
8ed4027
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
src/sandbox/filesystem.ts)src/sandbox/process.ts)src/sandbox/commands.ts)src/sandbox/config.ts)src/sandbox/instance.ts)src/sandbox/index.ts)src/cli/cmd/gym.ts)Original prompt
Summary
Implement a sandbox/gym environment for OpenCode that allows safe development and testing without risking accidental file system damage. This is the local-first implementation focusing on directory isolation and process-level sandboxing.
Goals
opencode gymcommandArchitecture
1. Sandbox Filesystem (
packages/opencode/src/sandbox/filesystem.ts)/tmp/opencode-sandbox-*)2. Process Isolation (
packages/opencode/src/sandbox/process.ts)3. Command Validation (
packages/opencode/src/sandbox/commands.ts)Block dangerous commands by default:
rm -rf /,rm -rf ~,rm -rf *sudo *chmod 777 /mkfs.*dd if=* of=/dev/*curl * | sh,wget * | sh> /dev/sda, etc.4. Gym Configuration (
packages/opencode/src/sandbox/config.ts)5. Sandbox Instance (
packages/opencode/src/sandbox/instance.ts)Wrap the existing
Instancesystem to provide sandbox context:6. Main Sandbox Module (
packages/opencode/src/sandbox/index.ts)Export unified interface:
7. CLI Command (
packages/opencode/src/cli/cmd/gym.ts)